home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Tetris Light 1.0 / source / windows.h < prev   
Text File  |  1993-07-18  |  2KB  |  57 lines

  1. /**********************************************************************\
  2.  
  3. File:        windows.h
  4.  
  5. Purpose:    Header file for the window handling module.  This module
  6.             implements a dispatch table mechanism which is used to
  7.             handle window events.
  8.  
  9.  
  10. ``Tetris Light'' - a simple implementation of a Tetris game.
  11. Copyright (C) 1993 Hoylen Sue
  12.  
  13. This program is free software; you can redistribute it and/or modify
  14. it under the terms of the GNU General Public License as published by
  15. the Free Software Foundation; either version 2 of the License, or
  16. (at your option) any later version.
  17.  
  18. This program is distributed in the hope that it will be useful,
  19. but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  21. GNU General Public License for more details.
  22.  
  23. You should have received a copy of the GNU General Public License
  24. along with this program; see the file COPYING.  If not, write to the
  25. Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  26.  
  27. \**********************************************************************/
  28.  
  29. #ifndef windows_H
  30. #define windows_H
  31.  
  32. /*--------------------------------------------------------------------*/
  33.  
  34. /* This structure is the dispatch table for window events.  Each
  35.    window created has its refCon set to point to one of these tables.
  36.    This method provides an extensible window handling mechanism. */
  37.  
  38. typedef struct {
  39.     void (* mouseDown_handler)(Point where);
  40.     void (* key_handler)(unsigned char code, unsigned char ascii);
  41.     void (* update_handler)(void);
  42.     void (* activate_handler)(void);
  43.     void (* deactivate_handler)(void);
  44. } Wind_table;
  45.  
  46. /*--------------------------------------------------------------------*/
  47.  
  48. void window_mouseDown(WindowPtr wind, Point where);
  49. void window_key(WindowPtr wind, unsigned char code, unsigned char ascii);
  50. void window_update(WindowPtr wind);
  51. void window_activate(WindowPtr wind);
  52. void window_deactivate(WindowPtr wind);
  53.  
  54. /*--------------------------------------------------------------------*/
  55.  
  56. #endif
  57.